import Foundation

enum Result<T, E> where E: Error {
    case success(T)
    case failure(E)
}
// 使用示例
let success = Result<String, Error>.success("Operation completed")
let failure = Result<String, Error>.failure(
    NSError(domain: "com.example.error", code: 1, userInfo: nil))
